Last Updated: February 25, 2016
6.532K
bchretien

Pimp my GDB

When it comes to debugging, those who decide to stick with GDB often end up regretting its austere interface.

But here's the thing: you can actually prettify your GDB interface!

The first project that makes it easily doable is Gdbinit. This was done with reverse-engineering in mind, hence the default parameters.

Gdbinit

This led to this other project that relies on GDB's Python support to provide the same features but with much more extensibility: (void)walker. Thus, if you want to add some more features or modify it, this is definitely a better choice.

(void)walker

Whatever you choose, you can simply add it to your dotfiles (~/.gdbinit should point to your actual .gdbinit file), and enjoy this color-enabled power-user-friendly GDB interface!

(note: this is based on my answer to this SO question)

Additional note

You can use extra scripts to provide additional features to GDB. Those scripts can either be written in pure GDB or rely on Python. This is typically useful when you want to print some C++ classes such as STL containers or Eigen matrices in a human-friendly way. You can find a set of examples here.

Recommend
Say Thanks
Update Notifications Off
Respond

2 Responses
Add your response

There is also cgdb, but this looks MUCH better for terminal users!

over 1 year ago ‧

@bcnjr5: yes, cgdb was the other solution that was presented in the Stack Overflow question I linked, but it is hardly better than basic gdb. The source window can help people learning C when going through their program I guess. There are also some other good GUI solutions like DDD or Nemiver, but in my case, GDB does everything I need. I just want my eyes to survive long GDB sessions :-)

over 1 year ago ‧
Hide Download Bar
Ctrl + Shift + Z = Show/Hide Download Bar
下載
Download Manager (S3)
清除
按左鍵: 移除全部已完成檔案
按右鍵: 復原上次清除項目
100%
下載歷史記錄
Download list is empty
riscv-spec-v2.2.pdf
100%
--:--
601 KB
-.--
riscv-spec-v2.2.pdf
Source:
從:
儲存至:
C:\Users\redegg\Desktop\riscv-spec-v2.2.pdf
狀態:
601 KB / 601 KB ( -.-- )
檔案大小:
601 KB
Virus scan:
開始時間:
2020.12.28 - 22:02:40
完成時間:
<00:01
剩餘時間:
--:--
完成百分比:
100%
平均速度:
3.24 MB/秒
mouse double click: download pause/resume
mouse middle click: download cancel
mouse double click: open file
mouse double click + Ctrl: open dir
mouse middle click: delete from list
mouse middle click + Ctrl: delete from system
press mouse button + Ctrl: drag & drop
riscv-spec.pdf
100%
--:--
1002 KB
-.--
riscv-spec.pdf
Source:
從:
儲存至:
C:\Users\redegg\Desktop\riscv-spec.pdf
狀態:
1002 KB / 1002 KB ( -.-- )
檔案大小:
1002 KB
Virus scan:
開始時間:
2020.12.28 - 22:04:20
完成時間:
<00:01
剩餘時間:
--:--
完成百分比:
100%
平均速度:
6.44 MB/秒
mouse double click: download pause/resume
mouse middle click: download cancel
mouse double click: open file
mouse double click + Ctrl: open dir
mouse middle click: delete from list
mouse middle click + Ctrl: delete from system
press mouse button + Ctrl: drag & drop